package com.news.web;

import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import com.news.service.DeptService;

@Controller
@RequestMapping("dept")
public class DeptController {

	@Resource
	private DeptService deptService;
	@RequestMapping("findAll")
	public String findAll(Map<String,Object> map){
		map.put("list", deptService.findAll());
		return "emp_list";
	}
	@RequestMapping("deleteDept/{id}")
	public String deleteDetp(@PathVariable("id") Integer id){
		deptService.deleteDept(id);
		return "redirect:/dept/findAll";
	}
}
